package com.cy.mall.service.order;

import com.cy.mall.model.PageBean;
import com.cy.mall.model.Result;
import com.cy.mall.model.ao.order.*;
import com.cy.mall.model.domain.order.OrderGoodsExtraInfo;
import com.cy.mall.model.dto.customer.CustomerLoginDTO;
import com.cy.mall.model.dto.fujue.req.AddAttachmentParamDTO;
import com.cy.mall.model.dto.fujue.resp.LoanApplyDataDTO;
import com.cy.mall.model.dto.fujue.resp.LoanDataDTO;
import com.cy.mall.model.dto.fujue.resp.NotifyDataDTO;
import com.cy.mall.model.enums.ThirdSource;
import com.cy.mall.model.enums.order.OrderFinalStatusE;
import com.cy.mall.model.enums.order.OrderImageType;
import com.cy.mall.model.query.order.OrderListQuery;
import com.cy.mall.model.vo.order.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单模块服务
 *
 * @author tanyilin
 *
 * @create 2019年2月26日 上午9:58:59
 */
public interface OrderService {

	/**
	 * 新增订单 （暂废弃）
	 * 
	 * @param addAO
	 * @param loginCustomer
	 * @return
	 */
	Result addOrder(OrderAddAO addAO, CustomerLoginDTO loginCustomer);

	/**
	 * 保存编辑订单 （暂废弃）
	 * 
	 * @param editAO
	 * @param loginCustomer
	 * @return
	 */
	Result editOrder(OrderEditAO editAO, CustomerLoginDTO loginCustomer);

	/**
	 * 查询新增订单回显信息字段 （暂废弃）
	 * 
	 * @param orderId
	 * @return
	 */
	OrderAddInfoDisplayVO getOrderDisplayInfo(Long orderId);

	/**
	 * 前台-订单列表
	 * @param query
	 * @return com.cy.mall.model.PageBean<com.cy.mall.model.vo.order.OrderListVO>
	 */
    PageBean<OrderListVO> selectOrderList(OrderListQuery query);

    /**
     * 前台-订单详情
     * @param orderId
     * @return com.cy.mall.model.vo.order.OrderDetailVO
     */
	OrderDetailVO selectOrderDetailVO(Long orderId);

	/**
	 * 保存进件数据
	 * @param applyDataDTO
	 * @param thirdSource
	 * @return void
	 */
	void saveApplyData(LoanApplyDataDTO applyDataDTO, ThirdSource thirdSource);

	/**
	 * 保存更新贷款数据
	 * @param loanData
	 * @param thirdSource
	 * @return void
	 */
	Result saveLoanData(LoanDataDTO loanData, ThirdSource thirdSource);

	/**
	 * 保存填写家具订单信息
	 * @param saveAO
	 * @return void
	 */
	void saveOrderGoodsExtraInfo(OrderGoodsExtraInfoSaveAO saveAO);

	/**
	 * 家易贷：确认申请信息并提交，生成订单
	 * @param confirmSubmitOrderAO
	 * @param customerId
	 * @return com.cy.mall.model.Result
	 */
	Result doConfirmSubmitOrder(ConfirmSubmitOrderAO confirmSubmitOrderAO, Long customerId);

	/**
	 * 查询 订单补充资料上传状态
	 * @param orderId
	 * @return com.cy.mall.model.vo.order.OrderImageUploadStatusVO
	 */
	OrderImageUploadStatusVO queryOrderImageUploadStatus(Long orderId);

	/**
	 * 查询订单图片（文件）资料列表
	 * @param orderId
	 * @param orderImageType
	 * @return java.util.List<com.cy.mall.model.vo.order.OrderImageListVO>
	 */
	List<OrderImageListVO> getOrderImageList(Long orderId, OrderImageType orderImageType);

	/**
	 * 保存订单图片（文件）资料
	 * @param saveAO
	 * @return void
	 */
	void doSaveOrderImage(OrderImageSaveAO saveAO);

	/**
	 * 获取订单补充资料参数
	 * @param orderId
	 * @return com.cy.mall.model.dto.fujue.req.AddAttachmentParamDTO
	 */
    AddAttachmentParamDTO getAddAttachmentParam(Long orderId);

    /**
     * 更新订单的最终状态
     * @param orderId
     * @param finalStatus
     * @return void
     */
	void updateOrderFinalStatus(Long orderId, OrderFinalStatusE finalStatus);

	/**
	 * 更新订单数据
	 * @param notifyData
	 * @return com.cy.mall.model.Result
	 */
	Result doUpdateOrderData(NotifyDataDTO notifyData);

	/**
	 * 通过客户手机号码清除订单数据
	 * @param mobile
	 * @return void
	 */
	void deleteAllOrderByMobile(String mobile);

	/**
	 * 通过 orderId 查询 OrderGoodsExtraInfo
	 * @param orderId
	 * @return com.cy.mall.model.domain.order.OrderGoodsExtraInfo
	 */
	OrderGoodsExtraInfo getOrderGoodsExtraInfoByOrderId(Long orderId);
}
